Get a list of client departments

This request is used to get a list of a client's departments.

Request syntax

GET https://b2b-api.go.yandex.ru/integration/2.0/departments/list?
limit=<number of records>
&offset=<number of records to skip>

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request parameters

The request may contain the following optional parameters:

  • limit: The number of records to print. If this parameter is omitted, information about the first 100 records is returned.

  • offset: The number of records to skip. If this parameter is omitted, information starting from the first record is returned.

Response field description

Responses may contain the following fields:

Field Description Format
items The list of departments. Array
limit The maximum number of records to return. Number
offset The number of records skipped. Number
total_amount The number of records found. Number

Structure of the items array element:

Field

Description

Format

ID

Department ID.

String

name

The name of the department.

String

parent_id

Parent department ID.

String

limits

Limits on the total amount department users can spend on services.
Specified as an object in the structure {<service>: {"budget": <number>}, ...}.
Acceptable service values:

  • taxi: Yandex Taxi
  • eats2: Yandex Eats
  • tanker: Yandex Fuel.

Array

Request example

GET https://b2b-api.go.yandex.ru/integration/2.0/departments/list?limit=100&offset=0
...
Authorization: Bearer <OAuth token>

Response example

An example response to this request looks like this:

{
  "items": [
    {
      "id": "a8187621244340d890b684иииbf298276",
      "name": "Accountants",
      "limits": {
        "taxi": {
          "budget": 10000
        },
        "eats2": {
          "budget": null
        },
        "tanker": {
          "budget": null
        }
      },
      "parent_id": null
    }
  ],
  "limit": 100,
  "offset": 0,
  "total_amount": 1
}

Response codes

The response to this request may contain the following standard HTTP codes:

  • 200: Request completed successfully.
  • 400: An unknown parameter or a parameter with an invalid value was passed in the request.
  • 401: The OAuth token is incorrect.
  • 403: The client doesn't have sufficient rights to run this request.
    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).
    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.